<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="commons/taglibs.jsp" %>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<title>广州天绎物联信息平台=>运行环境自动检测</title>

<link rel="Shortcut Icon" href="images/xf.ico" />
<link rel="Bookmark" href="images/xf.ico" />

<style type="text/css">
<!--
*{ margin:0; padding:0; border:0;}
body{ font-family:"宋体"; font-size:12px;}
a{ color:#000000; text-decoration:none;}
a:link{ color:blue; text-decoration:underline;}
a:hover{ color:#993300; text-decoration:underline;}
a:visited{ color:#993300; text-decoration:underline;}
.box_tip{ width:100%; float:left;}
.top_tip{ background:url(images/env/bg.jpg) repeat-x; width:100%; height:68px; float:left; padding-top:20px;}
.text_1_tip{ width:935px; float:left; line-height:20px; padding-top:15px; padding-left:25px; font-size:18px;}
a.text_2_tip{ color:#12a7da; text-decoration:underline;}
-->
</style>

</head>

<body>

  <div class="box_tip">
  <div class="top_tip"><img src="images/title.jpg" width="500" height="47"/></div>
  <div class="text_1_tip">

<script><!--

//检查浏览器
try
{
	var osVersion = CheckOSVersion();
	var bv = CheckBrowserVersion();
	
	//不是IE8.0
	if(bv != 'IE: 8.0')
	{
		//提示不是IE8.0
		document.write('<div style="border: 1px green solid;font-size: 16px;font-family: 微软雅黑;color: blue;padding: 8px;width:500px">尊敬的用户，您好！该系统只能通过微软IE8进行访问！');
		document.write('<br/>');
		document.write('您当前的浏览器是： '+bv);
		document.write('</div>');
		
		document.write("<br/>");
		document.write("1、如果您本机还没有安装IE8,您可以点击以下提供的链接，进行安装或者升级！");
		document.write("<br/>");
		if(osVersion == 'WindowsXP')
		{
			document.write("&nbsp;&nbsp;&nbsp;<a href='${ctx}/download/IE8-WindowsXP-x86-CHS.exe'>IE8自动升级链接</a>");
		}
		else if(osVersion == 'WindowsServer2003')
		{
			document.write("&nbsp;&nbsp;&nbsp;<a href='${ctx}/download/IE8-WindowsServer2003-x86-CHS.exe'>IE8自动升级链接</a>");
		}
		else
		{
			document.write("&nbsp;&nbsp;&nbsp;<a href='http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie-8'>IE8自动升级链接</a>");
		}
		document.write("<br/>");
		document.write("<br/>");
		
		document.write("2、如果您本机已经安装IE8,您可以先关闭该浏览器，再打开IE8运行本系统！");
		//document.write("<br/>");
		//document.write("&nbsp;&nbsp;&nbsp;<a href='javascript:runIE();'>点击自动切换到IE8</a>");
	   	document.write("<br/>");
	   	document.write("<br/>");	
	   	
	   	document.write("3、如果您不确定是否安装了IE8或者不了解其相关情况，您可以拨打网络管理员的电话，以获得相应的帮助！");
	   	document.write("<br/>");
		document.write("<br/>");
	   	document.write("<br/>");		
	   	
    	document.write("<br/>");
   		document.write('<div style="border: 1px green solid;font-size: 16px;font-family: 微软雅黑;color: red;padding: 8px;width:500px">由此跟您造成的不便，敬请谅解！</div>');
   		document.write("<br/>");
	}
	else
	{
		cfgIE();
		window.location.href = '${ctx}/welcome.jsp';
	}
}
catch(e)
{
   		document.write("<br/>");
   		document.write("<br/>");
  		document.write("未知错误，请跟网络管理员联系！");
  		
  		document.write("<br/>");
  		document.write("可能是原因是："+e.message);
}
/**
function runIE()
{
  	var ieExePath = shell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Capabilities\\ApplicationDescription");
	var index = ieExePath.indexOf(",");
	ieExePath = '"'+ieExePath.substr(1,index-1)+'"';
	
	var targetUrl = window.location.href;
	targetUrl = targetUrl+"welcome.jsp";
	shell.run(ieExePath+" "+targetUrl);
}
*/
//配置IE
function cfgIE()
{	
	var shell = createWSShell();
	
	//第一步：将”遇到弹出窗口时“的值改成”由Internet Explorer决定如何打开弹出窗口
	//var tabbedCgfPath = "HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\TabbedBrowsing\\PopupsUseNewWindow";
	//var tabbedVal = shell.RegRead(tabbedCgfPath);
	//if(tabbedVal != '0')
	//{
	//	shell.regWrite(tabbedCgfPath,'00000000','REG_DWORD');
	//}
	
	//第二步：弹出窗口阻止程序设置
}

function CheckBrowserVersion (){
    var Sys = {};
    
    var ua = navigator.userAgent.toLowerCase();
    var s;
    (s = ua.match(/maxthon ([\d.]+)/)) ? Sys.maxthon = s[1] :
    (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
    (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
    (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
    (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
    (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
    
    var browerVersion;
    
	if (Sys.maxthon) browerVersion = 'Maxthon: ' + Sys.maxthon;
    if (Sys.ie) browerVersion = 'IE: ' + Sys.ie;
    if (Sys.firefox) browerVersion='Firefox: ' + Sys.firefox;
    if (Sys.chrome) browerVersion = 'Chrome: ' + Sys.chrome;
    if (Sys.opera)browerVersion = 'Opera: ' + Sys.opera;
    if (Sys.safari) browerVersion = 'Safari: ' + Sys.safari;
    
    if(browerVersion == 'underfined' || browerVersion == '') browerVersion = "未知的浏览器版本";
    return browerVersion;
}

//创建WSShell对象
function createWSShell()
{
	var tWSShell;
	
	try
	{
		if (window.ActiveXObject) tWSShell = new ActiveXObject("WScript.Shell");
	}
	catch(e)
	{
	 	var msg = e.message;
	 	if(msg == 'Automation 服务器不能创建对象')
	 	{
		  	document.write("<br/>");
		  	document.write("ActiveX对象获取失败，请按以下步骤进行配置后，再进行检测！");
		  	document.write("<br/>");					    	
		 	document.write("1、请将当前站点设置为信任站点。");
		 	document.write("<br/>");
		 	document.write("2、点击菜单[工具=>Internet 选项(O)=>安全=>可信站点=>自定义级别=>对未标记为可完全执行脚本的ActiveX控件初始化并执行脚本=>启用]");
		  	document.write("<br/>");
		  	document.write("<br/>");
		  	document.write('<input type="button" onclick="againRun();" value="再次检测" />');
		  	document.write("<br/>");
		  	document.write("<br/>");
		  	document.write("<font color='red'>如果通过以上方式还是未能解决问题，请跟网络管理员联系！</font>");	
		  	document.write("<br/>");
		 }
		 else if(msg.indexOf("无法打开注册键值") >= 0)
	   	{
	   		document.write("<br/>");
	   		document.write("<br/>");
	   		document.write("本机还未安装IE,请跟系统管理员联系！");
	   		
	   	}else if(msg == 'ActiveXObject is not defined')
	   	{
	   		document.write("<br/>");
	   		document.write('<div style="border: 1px blue solid;font-size: 16px;font-family: 微软雅黑;color: red;padding: 8px;width:500px">尊敬的用户，您好！该系统只能通过微软IE8进行访问！</div>');
	   		document.write("");
	   	}
	   	else
	   	{
	   		document.write("<br/>");
	   		document.write("<br/>");
	   		document.write("未知错误，请跟系统管理员联系！");
	   		document.write("<br/>");
	   		document.write("<br/>");
	   		document.write("可能是原因是："+msg);
	   	}
	}
	
	return tWSShell;
}

function againRun(){
	window.location.reload();
}

function CheckOSVersion()
{
	var osName = "WindowsXP";
	
	var ua = window.navigator.userAgent;
	var osVersion = ua.split(";")[2];
	var osV = osVersion.substr(osVersion.length-3,3);
	switch(osV)
	{
		case "5.0":
		osName = "WindowsServer2000";
		break;
		
		case "5.1":
		osName = "WindowsXP";
		break;
		
		case "5.2":
		osName = "WindowsServer2003";
		break;
		
		case "6.0":
		osName = "Windows Vista";
		break;			
		
		case "6.1":
		osName = "Win7";
		break;		
		
		default:
		document.write("未知操作系统");
		break;
	}
	
	return osName;
}
--></script>
      
      </div>
  </div>
					
</body>
</html>
